<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        window.onload=function () {
            var inputEle = document.querySelector('#username');
            console.log(inputEle.id);
            console.log(inputEle['name']);
            inputEle.id='newid';
            inputEle['name']='newname';
            inputEle.setAttribute('value','new');

            var input2Ele = document.querySelector('#gender');
            input2Ele.checked=false;
            input2Ele.className='';
            input2Ele.style.backgroundColor='red';
            input2Ele.readOnly=false;
            console.log(inputEle.innerHTML);
            console.log(inputEle.innerText);
        }
    </script>
</head>
<body>
<input id="username" readonly name="username" value="张" pinyin="张">
<input id="gender" style="background-color: aqua" class="mycls" name="gender" type="radio" checked>男
</body>
</html>